﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using DapperExtensions.Mapper;
namespace LS.Entitys
{
    /// <summary>
    /// 菜单管理
    /// </summary>
    [Table("sys_menu")]
    public class SysMenuEntity:EntityBaseDateDel
    {
        /// <summary>
        /// 菜单名称
        /// </summary>
        public string MenuName { get; set; }
        /// <summary>
        /// 菜单url
        /// </summary>
        public string MenuUrl { get; set; }
        /// <summary>
        /// 菜单图标
        /// </summary>
        public string MenuIcon { get; set; }
        /// <summary>
        /// 菜单排序
        /// </summary>
        public int MenuSeq { get; set; }
        /// <summary>
        /// 是否菜单 1=是 0=否
        /// </summary>
        public bool? Isvisible { get; set; }
        /// <summary>
        /// 是否启用 1=是 0=否
        /// </summary>
        public bool? Isenable { get; set; }
        /// <summary>
        /// 菜单层级
        /// <summary>
        public int Menulevel { get; set; }

        /// <summary>
        /// Remark
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 菜单key 唯一标识
        /// </summary>
        public string Menucode { get; set; }

        /// <summary>
        /// 菜单父级编号
        /// </summary>
        public long? ParentId { get; set; }
        /// <summary>
        /// 0=_iframe 1=_blank
        /// </summary>
        public int? TargetType { get; set; }

        public string Rolecode { get; set; }
        public string Funcode { get; set; }
    }

    public class SysMenuEntityMapper : ClassMapper<SysMenuEntity>
    {
        public SysMenuEntityMapper()
        {
            Table("sys_menu");
            Map(a => a.Funcode).Ignore();
            Map(a => a.Rolecode).Ignore();
            AutoMap();
        }
    }

}
